<template>
   <view class="xmain">
     <headBar title="请选择题库"></headBar>
     <view class="signBox">
       <view class="singHeader">
         <uni-icons type="refreshempty" color="#FFFFFF"></uni-icons>
         <text>已更新最新题库</text>
       </view>
       <view class="subForm">
         <uni-forms ref="baseForm" :modelValue="baseFormData">
           <view class="subFormLines3" >
             <view>选择性别</view>
             <view style="margin-top: 30rpx;">
               <view class="uni-flex uni-row">
                 <view class="flex-item">
                   <uni-forms-item style="font-size:24rpx;">
                     <uni-data-checkbox v-model="baseFormData.sex" :localdata="sexs" />
                   </uni-forms-item>
                 </view>
               </view>
             </view>
           </view>
           <view class="subFormLines2" >
             <view class="uni-flex uni-row">
               <view class="flex-item">
                 报名状态：
               </view>
               <view class="flex-item" style="width:10rpx;"></view>
               <view class="flex-item">
                 <view class="uni-flex uni-row">
                   <view class="flex-item xk_btn" :class="signStatusBtn == 1 ? 'xk_btn_active' : ''"  @click="signStatusBtn = 1">未报名</view>
                   <view class="flex-item" style="width:20rpx;"></view>
                   <view class="flex-item xk_btn" :class="signStatusBtn == 2 ? 'xk_btn_active' : ''" @click="signStatusBtn = 2">已报名</view>
                 </view>
               </view>
             </view>
           </view>
           <view class="subFormLines3" >
             <view>驾照类型</view>
             <view style="margin-top: 30rpx;">
               <view class="uni-flex uni-row">
                 <view class="flex-item carType " v-for="(cheItem,che) in cheTypeList" :class="carType === che? 'carTypeFOCUS' : ''" @click="carType = che">
                   <view class="uni-flex uni-column">
                     <view class="flex-item"><image :src="'../../static/app_image/'+che+'.png'"></image></view>
                     <view class="flex-item">{{cheItem.alias}}</view>
                     <view class="flex-item" style="margin-top: 15rpx;">{{cheItem.remark}}</view>
                   </view>
                 </view>
               </view>
             </view>
           </view>
           <view style="height:50rpx;"></view>
           <view>
             <button type="primary" @click="xsubmit()">提交</button>
           </view>
         </uni-forms>
       </view>
     </view>
		 <bootNav nav="home"></bootNav>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				baseFormData: {
				  introduction: '',
				  sex: 2,
				},
				// 单选数据源
				sexs: [{
				  text: '男',
				  value: 0
				}, {
				  text: '女',
				  value: 1
				}, {
				  text: '保密',
				  value: 2
				}],
				signStatusBtn:1,
				carType:'xiaoche',
				cheTypeList:{
				  xiaoche:{alias:"小车",remark:"C1/C2/C3",model:"c1"},
				  huoche:{alias:"货车",remark:"A2/B2",model:"a2"},
				  keche:{alias:"客车",remark:"A1/A3/B1",model:"a1"},
				  motoche:{alias:"摩托车",remark:"D/E/F",model:"d"},
				},
			}
		},
    onShareAppMessage() {
      return {
        title: this.title,
      }
    },
    onShareTimeline: function() {
      return {
        title: this.title,
      }
    },
		onLoad() {
       var t = this;

		},
		methods: {
      xsubmit(){
        var t = this;
        if(t.xCacheSet('carType',t.carType)){
          uni.showToast({
            title: '设置成功',
            icon: 'success',
            duration: 2000
          })
          t.x_redirect('/pages/index/index?carType='+t.carType)
        }
      }
		}
	}
</script>

<style>
	@import "./sign.css";
  .singHeader{
    text-align: center;
    height:80rpx;
    line-height:80rpx;
    color:#FFFFFF;
  }
</style>
